<template>
	<view class="comp-photo-info flex-column-gap-16">
		<view class="photo-wrap">
			<view class="photo-box">
				<image :style="photoImageStyle" :src="data.imageUrl" mode="aspectFit"></image>
			</view>
		</view>
		<view>
			<text class="photo-name">名称：{{ data.name || '--' }}</text>
		</view>
		<view class="photo-detail flex-between-center">

			<view :class="['item', {'border-right': index < data.fieldList.length - 1}]"
				v-for="(item,index) in data.fieldList">
				<text class="normal-title">{{item.title || '--'}}
				</text>
				<text class="desc mt-4">{{item.desc || '--'}}</text>
			</view>
		</view>
	</view>
</template>


<script setup>
	import {
		ref,
		reactive,
		computed,
	} from "vue";

	import {
		getImgScaleStyle,
	} from '@/common/js/method';
	const props = defineProps({
		data: {
			type: Object
		},
	})
	// 缩放图片
	const photoImageStyle = computed(() => {
		return getImgScaleStyle(props.data.imageSize.width, props.data.imageSize.height, 236);
	});
</script>

<style lang="scss" scoped>
	.comp-photo-info {
		box-sizing: border-box;
		// height: 458rpx;
		border-radius: 16rpx;
		background: rgba(255, 255, 255, 1);
		box-shadow: 0px 2rpx 4rpx rgba(0, 0, 0, 0.02);
		padding: 32rpx;

		.photo-wrap {
			// height: 200rpx;
			box-sizing: border-box;
			background: rgba(245, 245, 245, 1);
			display: flex;
			justify-content: center;
			align-items: center;
			padding: 24rpx 0;
		}

		.photo-name {
			font-size: 32rpx;
			font-weight: 700;
			line-height: 48rpx;
			color: rgba(56, 56, 56, 1);
		}

		.photo-detail {
			display: flex;

			.item {
				display: flex;
				flex-direction: column;
				// align-items: center;
				flex: 1;
			}

			.border-right {
				border-right: 2rpx solid rgba(245, 245, 245, 1);
			}

			.pl-20 {
				padding-left: 40rpx;
			}

			.photo-item-desc {
				margin-top: 7rpx;
			}
		}
	}
</style>